From 5f4143dd40ceb120db3edd3e4446f01b4240313d Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Mon, 4 Jul 2022 11:16:20 +1000 Subject: [PATCH] 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 --- ports/rp2/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt index 9185c7d649..198512f885 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