Files
esp-idf/components/esp_driver_i2s/CMakeLists.txt
Renz Bagaporo 1f5cba3070 fix(ulp): clarify buildv2 child marker
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.
2026-07-29 13:08:23 +09:00

62 lines
1.8 KiB
CMake

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(include "include")
set(priv_requires esp_driver_gpio esp_driver_dma esp_pm esp_mm esp_hal_clock)
# TODO(IDF-15984): potentially remove __ULP_BUILDV2 handling from esp_driver_i2s
if(__ULP_BUILDV2)
# LP-core VAD shared code includes driver/lp_i2s_vad.h from
# ulp/lp_core/shared/include/ulp_lp_core_lp_vad_shared.h.
idf_component_register(INCLUDE_DIRS ${include}
REQUIRES esp_hal_i2s)
return()
endif()
if(${target} STREQUAL "esp32")
# ADC on esp32 is routed to I2S0, I2S driver needs to operate ADC to ensure the I2S function.
list(APPEND priv_requires esp_hal_ana_conv)
endif()
# I2S related source files
if(CONFIG_SOC_I2S_SUPPORTED)
list(APPEND srcs "i2s_common.c"
"i2s_std.c")
if(CONFIG_SOC_PAU_SUPPORTED)
list(APPEND srcs "${target}/i2s_retention.c")
endif()
if(CONFIG_SOC_I2S_SUPPORTS_PDM)
list(APPEND srcs "i2s_pdm.c")
endif()
if(CONFIG_SOC_I2S_SUPPORTS_TDM)
list(APPEND srcs "i2s_tdm.c")
endif()
if(CONFIG_SOC_I2S_SUPPORTS_ETM)
list(APPEND srcs "i2s_etm.c")
endif()
endif()
if(CONFIG_SOC_I2S_SUPPORTED OR CONFIG_SOC_LP_I2S_SUPPORTED)
list(APPEND srcs "i2s_platform.c")
endif()
if(CONFIG_SOC_LP_I2S_SUPPORTED)
list(APPEND srcs "lp_i2s.c" "lp_i2s_std.c" "lp_i2s_pdm.c")
endif()
if(CONFIG_SOC_LP_I2S_SUPPORT_VAD)
list(APPEND srcs "lp_i2s_vad.c")
endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${include}
PRIV_INCLUDE_DIRS "."
PRIV_REQUIRES ${priv_requires}
REQUIRES esp_hal_i2s
LDFRAGMENTS linker.lf
)