arduino_compat/Arduino.h includes esphome/core/hal.h, which only resolves relative to the generated project's src/ directory. Add that as an include dir on the vendor component too.
@@ -14,6 +14,9 @@ endif()
idf_component_register(
SRCS ${GXEPD2_SOURCES}
INCLUDE_DIRS "src"
- PRIV_INCLUDE_DIRS "../arduino_compat"
+ # ${CMAKE_SOURCE_DIR}/src is the ESPHome-generated main component's source
+ # root: arduino_compat/Arduino.h includes "esphome/core/hal.h", which only
+ # resolves relative to that directory.
+ PRIV_INCLUDE_DIRS "../arduino_compat" "${CMAKE_SOURCE_DIR}/src"
PRIV_REQUIRES driver
)