fix: preserve Linux component header registration

Keep Linux components include-only when their runtime dependencies are unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Marius Vikhammer
2026-07-06 13:36:34 +08:00
co-authored by Cursor
parent bd25b59620
commit e2c86567ac
12 changed files with 98 additions and 81 deletions
+8 -6
View File
@@ -1,9 +1,5 @@
idf_build_get_property(target IDF_TARGET)
if(${target} STREQUAL "linux")
return() # This component is not supported by the POSIX/Linux simulator
endif()
set(srcs)
set(public_include "include")
if(CONFIG_SOC_PARLIO_SUPPORTED)
@@ -21,12 +17,18 @@ if(CONFIG_SOC_PARLIO_SUPPORTED)
endif()
set(priv_requires esp_pm esp_driver_gpio esp_mm esp_driver_bitscrambler esp_driver_dma)
if(${target} STREQUAL "linux")
set(requires "")
set(priv_requires "")
else()
set(requires esp_hal_parlio)
set(priv_requires esp_pm esp_driver_gpio esp_mm esp_driver_bitscrambler esp_driver_dma)
endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${public_include}
PRIV_INCLUDE_DIRS "src"
PRIV_REQUIRES "${priv_requires}"
REQUIRES esp_hal_parlio
REQUIRES "${requires}"
LDFRAGMENTS "linker.lf"
)