Skip to content

Commit 4251594

Browse files
jimmoletgo0007
authored andcommitted
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 <[email protected]>
1 parent d6ce175 commit 4251594

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ports/rp2/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ if(MICROPY_PY_BLUETOOTH)
206206
endif()
207207

208208
if(MICROPY_BLUETOOTH_NIMBLE)
209+
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/mynewt-nimble)
210+
if(NOT (${ECHO_SUBMODULES}) AND NOT EXISTS ${MICROPY_DIR}/lib/mynewt-nimble/nimble/host/include/host/ble_hs.h)
211+
message(FATAL_ERROR " mynewt-nimble not initialized.\n Run 'make BOARD=${MICROPY_BOARD} submodules'")
212+
endif()
213+
209214
list(APPEND MICROPY_SOURCE_PORT mpnimbleport.c)
210215
target_compile_definitions(${MICROPY_TARGET} PRIVATE
211216
MICROPY_BLUETOOTH_NIMBLE=1
@@ -223,6 +228,9 @@ endif()
223228

224229
if (MICROPY_PY_NETWORK_CYW43)
225230
string(CONCAT GIT_SUBMODULES "${GIT_SUBMODULES} " lib/cyw43-driver)
231+
if((NOT (${ECHO_SUBMODULES})) AND NOT EXISTS ${MICROPY_DIR}/lib/cyw43-driver/src/cyw43.h)
232+
message(FATAL_ERROR " cyw43-driver not initialized.\n Run 'make BOARD=${MICROPY_BOARD} submodules'")
233+
endif()
226234

227235
target_compile_definitions(${MICROPY_TARGET} PRIVATE
228236
MICROPY_PY_NETWORK_CYW43=1

0 commit comments

Comments
 (0)