Skip to content

Commit e3c2cf7

Browse files
agattidpgeorge
authored andcommitted
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>
1 parent 048cccc commit e3c2cf7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ports/esp32/esp32_common.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ include(${MICROPY_DIR}/py/py.cmake)
4242
if(NOT CMAKE_BUILD_EARLY_EXPANSION)
4343
# Enable extmod components that will be configured by extmod.cmake.
4444
# A board may also have enabled additional components.
45-
set(MICROPY_PY_BTREE ON)
45+
if (NOT DEFINED MICROPY_PY_BTREE)
46+
set(MICROPY_PY_BTREE ON)
47+
endif()
4648

4749
include(${MICROPY_DIR}/py/usermod.cmake)
4850
include(${MICROPY_DIR}/extmod/extmod.cmake)
@@ -276,7 +278,9 @@ target_include_directories(${MICROPY_TARGET} PUBLIC
276278
)
277279
278280
# Add additional extmod and usermod components.
279-
target_link_libraries(${MICROPY_TARGET} micropy_extmod_btree)
281+
if (MICROPY_PY_BTREE)
282+
target_link_libraries(${MICROPY_TARGET} micropy_extmod_btree)
283+
endif()
280284
target_link_libraries(${MICROPY_TARGET} usermod)
281285
282286
# Extra linker options

0 commit comments

Comments
 (0)