mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
Rename the internal ULP child-build marker to __ULP_BUILDV2 so component CMake files make the build-system scope explicit. Document that the marker is currently set only by the IDF_BUILD_V2 ULP child path.
46 lines
1.1 KiB
CMake
46 lines
1.1 KiB
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()
|
|
|
|
# TODO(IDF-15986): potentially remove __ULP_BUILDV2 handling from esp_hal_gpspi
|
|
if(__ULP_BUILDV2)
|
|
# LP-core SPI code includes SPI HAL headers from
|
|
# ulp/lp_core/lp_core/lp_core_spi.c.
|
|
idf_component_register(INCLUDE_DIRS ${includes}
|
|
REQUIRES soc hal esp_hal_dma)
|
|
return()
|
|
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()
|