Files
esp-idf/components/esp_hal_gpspi/CMakeLists.txt
T
Marius VikhammerandCursor e2c86567ac fix: preserve Linux component header registration
Keep Linux components include-only when their runtime dependencies are unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 13:36:34 +08:00

37 lines
795 B
CMake

idf_build_get_property(target IDF_TARGET)
set(srcs)
set(includes "include")
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/include")
list(APPEND includes "${target}/include")
endif()
if(CONFIG_SOC_GPSPI_SUPPORTED)
list(APPEND srcs
"${target}/spi_periph.c"
"spi_hal.c"
"spi_hal_iram.c"
"spi_slave_hal.c"
"spi_slave_hal_iram.c"
)
if(CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2)
list(APPEND srcs "spi_slave_hd_hal.c")
endif()
endif()
if(${target} STREQUAL "linux")
idf_component_register(
INCLUDE_DIRS ${includes}
REQUIRES soc hal
)
else()
idf_component_register(
SRCS ${srcs}
INCLUDE_DIRS ${includes}
REQUIRES soc hal esp_hal_dma
PRIV_REQUIRES esp_hal_gpio
)
endif()