From e3c2cf7a040052143b19ef140fd666f86ec0fbda Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Fri, 21 Mar 2025 02:12:31 +0100 Subject: [PATCH] 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 --- ports/esp32/esp32_common.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/esp32/esp32_common.cmake b/ports/esp32/esp32_common.cmake index a9827249b..c54f5a540 100644 --- a/ports/esp32/esp32_common.cmake +++ b/ports/esp32/esp32_common.cmake @@ -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