Skip to content

get_app_flags and prepare_build_envs in espidf.py fail on cmake compileCommandFragments where -include and its path are split across two entries (e.g. esp_lvgl_adapter) #1730

@arvidj01

Description

@arvidj01

I discovered the issue and CLAUDE provided the fix ...

Steps to reproduce: Add espressif/esp_lvgl_adapter as a dependency. Build a project with any source file. Get xtensa-esp-elf-gcc: fatal error: cannot specify '-o' with '-c' with multiple files.

Root cause: esp_lvgl_adapter uses target_compile_options(... PUBLIC -include "path"). cmake stores these as two separate compileCommandFragments. _extract_flags adds the bare path to CFLAGS as a plain string; after sorted(), it ends up as a positional GCC argument alongside the real source file. prepare_build_envs loses the -include entirely and puts the path in LIBS.

Attached is a temporary solution that needs to be applied and the reapplied after every platform update:

python3 scripts/patch_pio_espidf.py

patch_pio_espidf.py

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions