fix(cmake) require 'main' for Micropython (#2444)

Commit f2c2393b30 (#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.
This commit is contained in:
Amir Gonnen 2021-08-13 20:30:00 +03:00 committed by GitHub
parent e8c1670381
commit e602b3f0eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")