esp32/esp32_common.cmake: Skip BTree module when requested.

This commit makes the BTree module truly optional, as it was
unconditionally enabled in the shared CMake script for the port.

This meant that if a board/variant did explicitly turn BTree off said
request was not honoured by the build system and the BTree module would
still be brought in.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit is contained in:
Alessandro Gatti 2025-03-21 02:12:31 +01:00 committed by Damien George
parent 048ccccee0
commit e3c2cf7a04

View file

@ -42,7 +42,9 @@ include(${MICROPY_DIR}/py/py.cmake)
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
# Enable extmod components that will be configured by extmod.cmake.
# A board may also have enabled additional components.
set(MICROPY_PY_BTREE ON)
if (NOT DEFINED MICROPY_PY_BTREE)
set(MICROPY_PY_BTREE ON)
endif()
include(${MICROPY_DIR}/py/usermod.cmake)
include(${MICROPY_DIR}/extmod/extmod.cmake)
@ -276,7 +278,9 @@ target_include_directories(${MICROPY_TARGET} PUBLIC
)
# Add additional extmod and usermod components.
target_link_libraries(${MICROPY_TARGET} micropy_extmod_btree)
if (MICROPY_PY_BTREE)
target_link_libraries(${MICROPY_TARGET} micropy_extmod_btree)
endif()
target_link_libraries(${MICROPY_TARGET} usermod)
# Extra linker options