summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-07-04 11:16:20 +1000
committerDamien George <damien@micropython.org>2022-07-05 23:00:36 +1000
commit5f4143dd40ceb120db3edd3e4446f01b4240313d (patch)
treecf6d466ea4ed3d52b2540c554426e16ccfc5be02
parent651b3704845bff116334993d2a4752d78d23a068 (diff)
rp2/CMakeLists: Give error if required submodules are missing.
Ensure that nimble and cyw43-driver are initialised when the board requires it. Also make these work with `make submodules`. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
-rw-r--r--ports/rp2/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt
index 9185c7d64..198512f88 100644
--- a/ports/rp2/CMakeLists.txt
+++ b/ports/rp2/CMakeLists.txt
@@ -206,6 +206,11 @@ if(MICROPY_PY_BLUETOOTH)
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)
+ message(FATAL_ERROR " mynewt-nimble not initialized.\n Run 'make BOARD=${MICROPY_BOARD} submodules'")
+ endif()
+
list(APPEND MICROPY_SOURCE_PORT mpnimbleport.c)
target_compile_definitions(${MICROPY_TARGET} PRIVATE
MICROPY_BLUETOOTH_NIMBLE=1
@@ -223,6 +228,9 @@ endif()
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)
+ message(FATAL_ERROR " cyw43-driver not initialized.\n Run 'make BOARD=${MICROPY_BOARD} submodules'")
+ endif()
target_compile_definitions(${MICROPY_TARGET} PRIVATE
MICROPY_PY_NETWORK_CYW43=1