diff --git a/components/esp_adc/CMakeLists.txt b/components/esp_adc/CMakeLists.txt index 6d3d4fbaba..0c602f92c1 100644 --- a/components/esp_adc/CMakeLists.txt +++ b/components/esp_adc/CMakeLists.txt @@ -4,10 +4,12 @@ set(includes "include" "interface" "${target}/include" "deprecated/include") set(srcs "adc_cali.c" "adc_cali_curve_fitting.c" - "adc_oneshot.c" - "adc_common.c" "deprecated/esp_adc_cal_common_legacy.c") +if(CONFIG_SOC_ADC_SUPPORTED) + list(APPEND srcs "adc_oneshot.c" "adc_common.c") +endif() + if(CONFIG_SOC_ADC_DMA_SUPPORTED) list(APPEND srcs "adc_continuous.c") if(CONFIG_SOC_ADC_MONITOR_SUPPORTED) diff --git a/components/hal/CMakeLists.txt b/components/hal/CMakeLists.txt index 892a368377..f88e8bc0be 100644 --- a/components/hal/CMakeLists.txt +++ b/components/hal/CMakeLists.txt @@ -40,8 +40,6 @@ if(NOT BOOTLOADER_BUILD) "gpio_hal.c" "uart_hal.c" "uart_hal_iram.c" - "adc_hal_common.c" - "adc_oneshot_hal.c" "${target}/clk_tree_hal.c") if(NOT CONFIG_APP_BUILD_TYPE_PURE_RAM_APP) @@ -110,6 +108,10 @@ if(NOT BOOTLOADER_BUILD) list(APPEND srcs "parlio_hal.c") endif() + if(CONFIG_SOC_ADC_SUPPORTED) + list(APPEND srcs "adc_hal_common.c" "adc_oneshot_hal.c") + endif() + if(CONFIG_SOC_ADC_DMA_SUPPORTED) list(APPEND srcs "adc_hal.c") endif()