feat(esp_lvgl_port): add native cmakev2 build path#780
Conversation
Adds CMakeLists_v2.txt with a pure cmakev2 component definition. CMakeLists.txt dispatches to it when IDF_BUILD_V2 is set; the existing v1 code path is unchanged. project_include.cmake branches the LVGL version probe in lvgl_port_create_c_image to use the v2 short-name interface cache when IDF_BUILD_V2 is set. The v2 file uses native cmake primitives -- add_library + target_sources / target_link_libraries -- instead of an idf_component_register call. Optional integrations (button, esp_lcd_touch, knob, usb_host_hid) collapse to one block each because the v2 interface cache resolves the short name to either the local component or the espressif__* managed variant. Verified on components/esp_lvgl_port/test_apps/lvgl_port: v1 and v2 produce byte-identical object files (after stripping debug-info paths) and the same set of lvgl_port_* symbols in the final ELF. Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
In lvgl_port_create_c_image, set lvgl_name via idf_component_get_property(... lvgl COMPONENT_NAME) so it holds the resolved full name (lvgl or lvgl__lvgl), matching the v1 branch semantics. The previous hardcoded short name worked only because the v2 interface cache resolves short names in later property lookups too. Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
|
@fhrbata Thank you very much for this help!
when I remove Should I update all BSPs to components without Thank you! |
Sorry for the troubles.
I think this is a bug we are currently working on. When PSRAM is enabled by application, the bootloader compilation fails because the esp_hw_support component is shared between app and bootloader and bootloader now sees full configuration. Hopefully we will be able to figure this out soon.
I think I've seen similar problem yesterday when I was testing this PR. IIUC the problem is that we don't pass full list of local components to the component manager when dependencies are injected. So component manager reports back Unless I've missed something I believe both are unfortunately bugs in the cmakev2. |
Thank you! It seems that I should wait for fix both issues. Could you ping me, when it will be fixed? Or can I watch some task or PR? |
I will post the update here once it's fixed. Thank you! |
Summary
Adds a v2-native build path for esp_lvgl_port, dispatched from CMakeLists.txt
when IDF_BUILD_V2 is set. The existing v1 code stays in place for legacy IDF
builds.
idf_component_register shim. Single STATIC component target instead of
v1's INTERFACE component + separate lvgl_port_lib. Short-name resolution
collapses the dual-namespace optional-integration blocks.
lvgl_port_create_c_image's LVGL version probe.
Notes
(__get_component_interface) in a local _lvgl_port_optional_include
function. The docstring explains it stands in for a missing public
cmakev2 API (a non-fatal idf_component_include). The wrapper can be
deleted when the build system grows that API.
Test plan
cmakev2; both succeed to .bin.
esp_lvgl_port_touch.c byte-identical between v1 and v2 builds (after
xtensa-esp32s3-elf-strip -g).