Browse Source

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>
pull/8878/head
Jim Mussared 2 years ago
committed by Damien George
parent
commit
5f4143dd40
  1. 8
      ports/rp2/CMakeLists.txt

8
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

Loading…
Cancel
Save