esp-idf/components/esp_hw_support/CMakeLists.txt

109 lines
3.3 KiB
CMake
Raw Normal View History

idf_build_get_property(target IDF_TARGET)
# On Linux, we only support a few features, hence this simple component registration
if(${target} STREQUAL "linux")
idf_component_register(SRCS "port/linux/esp_random.c"
"port/linux/chip_info.c"
INCLUDE_DIRS "include")
return()
endif()
set(requires soc)
# only esp_hw_support/adc_share_hw_ctrl.c requires efuse component
set(priv_requires efuse spi_flash bootloader_support)
set(srcs "cpu.c" "esp_memory_utils.c")
if(NOT BOOTLOADER_BUILD)
2022-06-27 23:06:27 -04:00
list(APPEND srcs "esp_clk.c"
2021-03-10 08:39:29 -05:00
"clk_ctrl_os.c"
"hw_random.c"
"intr_alloc.c"
"mac_addr.c"
"periph_ctrl.c"
"rtc_module.c"
"sleep_modes.c"
"sleep_gpio.c"
"sleep_mac_bb.c"
"regi2c_ctrl.c"
2022-12-16 02:37:02 -05:00
"adc_share_hw_ctrl.c"
"port/${target}/io_mux.c")
2022-06-27 23:06:27 -04:00
if(NOT CONFIG_IDF_TARGET_ESP32 AND NOT CONFIG_IDF_TARGET_ESP32S2)
list(APPEND srcs "sleep_retention.c")
endif()
# [refactor-todo]: requires "driver" for GPIO and RTC (by sleep_gpio and sleep_modes)
list(APPEND priv_requires driver esp_timer)
if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2)
list(APPEND srcs "rtc_wdt.c")
endif()
2022-06-27 23:06:27 -04:00
if(CONFIG_SOC_GDMA_SUPPORTED)
2022-09-13 06:47:08 -04:00
list(APPEND srcs "dma/gdma.c" "dma/async_memcpy_impl_gdma.c")
2022-06-27 23:06:27 -04:00
endif()
if(CONFIG_SOC_CP_DMA_SUPPORTED)
2022-09-13 06:47:08 -04:00
list(APPEND srcs "dma/async_memcpy_impl_cp_dma.c")
2022-06-27 23:06:27 -04:00
endif()
if(CONFIG_SOC_GDMA_SUPPORTED OR CONFIG_SOC_CP_DMA_SUPPORTED)
2022-09-13 06:47:08 -04:00
list(APPEND srcs "dma/esp_async_memcpy.c")
endif()
if(CONFIG_SOC_GDMA_SUPPORT_ETM)
list(APPEND srcs "dma/gdma_etm.c")
2022-06-27 23:06:27 -04:00
endif()
if(CONFIG_SOC_SYSTIMER_SUPPORTED)
list(APPEND srcs "port/${target}/systimer.c")
endif()
2022-10-03 10:16:59 -04:00
if(CONFIG_SOC_HMAC_SUPPORTED)
list(APPEND srcs "esp_hmac.c")
endif()
2022-07-12 02:44:10 -04:00
if(CONFIG_SOC_ETM_SUPPORTED)
list(APPEND srcs "esp_etm.c")
endif()
if(CONFIG_SOC_DIG_SIGN_SUPPORTED)
list(APPEND srcs "esp_ds.c")
endif()
if(CONFIG_SOC_MODEM_CLOCK_IS_INDEPENDENT)
list(APPEND srcs "modem_clock.c")
endif()
if(CONFIG_SOC_MEMSPI_SRC_FREQ_120M)
list(APPEND srcs "mspi_timing_tuning.c" "port/${target}/mspi_timing_config.c")
endif()
if(CONFIG_IDF_TARGET_ESP32H2)
list(REMOVE_ITEM srcs
"adc_share_hw_ctrl.c" # TODO: IDF-6215
)
endif()
else()
# Requires "_esp_error_check_failed()" function
list(APPEND priv_requires "esp_system")
2021-02-18 08:09:27 -05:00
endif()
idf_component_register(SRCS ${srcs}
2021-03-03 05:21:07 -05:00
INCLUDE_DIRS include include/soc include/soc/${target}
PRIV_INCLUDE_DIRS port/include include/esp_private
REQUIRES ${requires}
2021-03-19 08:03:13 -04:00
PRIV_REQUIRES "${priv_requires}"
LDFRAGMENTS linker.lf)
idf_build_get_property(target IDF_TARGET)
add_subdirectory(port/${target})
2021-03-19 03:54:30 -04:00
2022-05-10 22:32:56 -04:00
if(NOT BOOTLOADER_BUILD)
if(CONFIG_SPIRAM)
idf_component_optional_requires(PRIVATE esp_psram)
2021-03-19 03:54:30 -04:00
endif()
endif()
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")