mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
rp2,esp32,extmod: Implement UPDATE_SUBMODULES in CMake.
Rather than having Make calling CMake to generate a list of submodules and then run a Make target (which is complex and prone to masking other errors), implement the submodule update logic in CMake itself. Internal CMake-side changes are that GIT_SUBMODULES is now a CMake list, and the trigger variable name is changed from ECHO_SUBMODULES to UPDATE_SUBMODULES. The run is otherwise 100% a normal CMake run now, so most of the other special casing can be removed. Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
committed by
Damien George
parent
2db0c0225f
commit
cccac2cc01
@@ -76,8 +76,8 @@ if (MICROPY_PY_NETWORK_CYW43)
|
||||
endif()
|
||||
|
||||
# Necessary submodules for all boards.
|
||||
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/mbedtls)
|
||||
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/tinyusb)
|
||||
list(APPEND GIT_SUBMODULES lib/mbedtls)
|
||||
list(APPEND GIT_SUBMODULES lib/tinyusb)
|
||||
|
||||
# Include component cmake fragments
|
||||
include(${MICROPY_DIR}/py/py.cmake)
|
||||
@@ -340,7 +340,7 @@ if (MICROPY_PY_BLUETOOTH_CYW43)
|
||||
endif()
|
||||
|
||||
if (MICROPY_BLUETOOTH_BTSTACK)
|
||||
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/btstack)
|
||||
list(APPEND GIT_SUBMODULES lib/btstack)
|
||||
|
||||
list(APPEND MICROPY_SOURCE_PORT mpbtstackport.c)
|
||||
|
||||
@@ -358,8 +358,8 @@ if (MICROPY_BLUETOOTH_BTSTACK)
|
||||
endif()
|
||||
|
||||
if(MICROPY_BLUETOOTH_NIMBLE)
|
||||
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/mynewt-nimble)
|
||||
if(NOT (${ECHO_SUBMODULES}) AND NOT EXISTS ${MICROPY_DIR}/lib/mynewt-nimble/nimble/host/include/host/ble_hs.h)
|
||||
list(APPEND GIT_SUBMODULES lib/mynewt-nimble)
|
||||
if(NOT UPDATE_SUBMODULES AND NOT EXISTS ${MICROPY_DIR}/lib/mynewt-nimble/nimble/host/include/host/ble_hs.h)
|
||||
message(FATAL_ERROR " mynewt-nimble not initialized.\n Run 'make BOARD=${MICROPY_BOARD} submodules'")
|
||||
endif()
|
||||
|
||||
@@ -386,8 +386,8 @@ target_include_directories(${MICROPY_TARGET} PRIVATE
|
||||
)
|
||||
|
||||
if (MICROPY_PY_NETWORK_CYW43)
|
||||
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/cyw43-driver)
|
||||
if((NOT (${ECHO_SUBMODULES})) AND NOT EXISTS ${MICROPY_DIR}/lib/cyw43-driver/src/cyw43.h)
|
||||
list(APPEND GIT_SUBMODULES lib/cyw43-driver)
|
||||
if(NOT UPDATE_SUBMODULES AND NOT EXISTS ${MICROPY_DIR}/lib/cyw43-driver/src/cyw43.h)
|
||||
message(FATAL_ERROR " cyw43-driver not initialized.\n Run 'make BOARD=${MICROPY_BOARD} submodules'")
|
||||
endif()
|
||||
|
||||
@@ -433,8 +433,8 @@ if (MICROPY_PY_NETWORK_NINAW10)
|
||||
endif()
|
||||
|
||||
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)
|
||||
list(APPEND GIT_SUBMODULES lib/wiznet5k)
|
||||
if(NOT UPDATE_SUBMODULES AND NOT EXISTS ${MICROPY_DIR}/lib/wiznet5k/README.md)
|
||||
message(FATAL_ERROR " wiznet5k not initialized.\n Run 'make BOARD=${MICROPY_BOARD} submodules'")
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user