rp2/Makefile: Always use cmake to discover submodules.
Used to be special-cased for Pico, but now everything depends on micropython-lib if it's using a frozen manifest. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
parent
be83c08f46
commit
9a7ac41be6
@ -54,6 +54,10 @@ if (MICROPY_PY_NETWORK_CYW43)
|
|||||||
set(PICO_CYW43_DRIVER_PATH ${MICROPY_DIR}/lib/cyw43-driver)
|
set(PICO_CYW43_DRIVER_PATH ${MICROPY_DIR}/lib/cyw43-driver)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Necessary submodules for all boards.
|
||||||
|
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/mbedtls)
|
||||||
|
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/tinyusb)
|
||||||
|
|
||||||
# Include component cmake fragments
|
# Include component cmake fragments
|
||||||
include(${MICROPY_DIR}/py/py.cmake)
|
include(${MICROPY_DIR}/py/py.cmake)
|
||||||
include(${MICROPY_DIR}/extmod/extmod.cmake)
|
include(${MICROPY_DIR}/extmod/extmod.cmake)
|
||||||
@ -278,6 +282,11 @@ if (MICROPY_PY_NETWORK_NINAW10)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MICROPY_PY_NETWORK_WIZNET5K)
|
if (MICROPY_PY_NETWORK_WIZNET5K)
|
||||||
|
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/wiznet5k)
|
||||||
|
if((NOT (${ECHO_SUBMODULES})) AND NOT EXISTS ${MICROPY_DIR}/lib/wiznet5k/README.md)
|
||||||
|
message(FATAL_ERROR " wiznet5k not initialized.\n Run 'make BOARD=${MICROPY_BOARD} submodules'")
|
||||||
|
endif()
|
||||||
|
|
||||||
target_compile_definitions(${MICROPY_TARGET} PRIVATE
|
target_compile_definitions(${MICROPY_TARGET} PRIVATE
|
||||||
MICROPY_PY_NETWORK_WIZNET5K=1
|
MICROPY_PY_NETWORK_WIZNET5K=1
|
||||||
WIZCHIP_PREFIXED_EXPORTS=1
|
WIZCHIP_PREFIXED_EXPORTS=1
|
||||||
@ -312,8 +321,6 @@ if (MICROPY_PY_NETWORK_WIZNET5K)
|
|||||||
list(APPEND MICROPY_SOURCE_EXTMOD
|
list(APPEND MICROPY_SOURCE_EXTMOD
|
||||||
${MICROPY_DIR}/extmod/network_wiznet5k.c
|
${MICROPY_DIR}/extmod/network_wiznet5k.c
|
||||||
)
|
)
|
||||||
|
|
||||||
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/wiznet5k)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add qstr sources for extmod and usermod, in case they are modified by components above.
|
# Add qstr sources for extmod and usermod, in case they are modified by components above.
|
||||||
|
@ -29,17 +29,10 @@ all:
|
|||||||
clean:
|
clean:
|
||||||
$(RM) -rf $(BUILD)
|
$(RM) -rf $(BUILD)
|
||||||
|
|
||||||
GIT_SUBMODULES += lib/mbedtls lib/tinyusb
|
# First ensure that pico-sdk is initialised, then use cmake to pick everything
|
||||||
|
# else (including board-specific dependencies).
|
||||||
submodules:
|
submodules:
|
||||||
# lib/pico-sdk is required for the cmake build to function (as used for boards other than PICO below)
|
|
||||||
$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="lib/pico-sdk" submodules
|
$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="lib/pico-sdk" submodules
|
||||||
ifeq ($(BOARD),PICO)
|
GIT_SUBMODULES=$$(cmake -B $(BUILD)/submodules -DECHO_SUBMODULES=1 ${CMAKE_ARGS} -S . 2>&1 | \
|
||||||
# Run the standard submodules target with minimum required submodules above
|
grep '^GIT_SUBMODULES=' | cut -d= -f2); \
|
||||||
$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="$(GIT_SUBMODULES)" submodules
|
|
||||||
else
|
|
||||||
# Run submodules task through cmake interface to pick up any board specific dependencies.
|
|
||||||
GIT_SUBMODULES=$$(cmake -B $(BUILD)/submodules -DECHO_SUBMODULES=1 -DGIT_SUBMODULES="$(GIT_SUBMODULES)" ${CMAKE_ARGS} -S . 2>&1 | \
|
|
||||||
grep 'GIT_SUBMODULES=' | cut -d= -f2); \
|
|
||||||
$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="$${GIT_SUBMODULES}" submodules
|
$(MAKE) -f ../../py/mkrules.mk GIT_SUBMODULES="$${GIT_SUBMODULES}" submodules
|
||||||
endif
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user