From e602b3f0ebba0fc3cd88cb7bec227965b50cf28c Mon Sep 17 00:00:00 2001 From: Amir Gonnen Date: Fri, 13 Aug 2021 20:30:00 +0300 Subject: [PATCH] fix(cmake) require 'main' for Micropython (#2444) Commit f2c2393b305cd71d2fc01ff8945965dccb8488b4 (#2420) breaks lv_micropython esp32 port. Apparently main dependency is require for LVGL when building Micropython, otherwise GC related code breaks This commit adds 'main' dependency to LVGL conditionally only if building inside lv_micropython. --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa54a4093..7d2f3cdf4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,16 @@ if(ESP_PLATFORM) file(GLOB_RECURSE SOURCES src/*.c) -idf_component_register(SRCS ${SOURCES} - INCLUDE_DIRS . src ../) +idf_build_get_property(LV_MICROPYTHON LV_MICROPYTHON) + +if (LV_MICROPYTHON) + idf_component_register(SRCS ${SOURCES} + INCLUDE_DIRS . src ../ + REQUIRES main) +else() + idf_component_register(SRCS ${SOURCES} + INCLUDE_DIRS . src ../) +endif() target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_CONF_INCLUDE_SIMPLE")