diff --git a/ports/esp32/main/CMakeLists.txt b/ports/esp32/main/CMakeLists.txt index b186cc1685bc4..297bee1e3fda0 100644 --- a/ports/esp32/main/CMakeLists.txt +++ b/ports/esp32/main/CMakeLists.txt @@ -108,7 +108,6 @@ set(IDF_COMPONENTS bootloader_support bt driver - esp_adc_cal esp_common esp_eth esp_event @@ -135,6 +134,12 @@ set(IDF_COMPONENTS nghttp ) +if(IDF_VERSION_MAJOR GREATER_EQUAL 5) + list(APPEND IDF_COMPONENTS esp_adc_cal) +elseif(IDF_VERSION_MAJOR GREATER_EQUAL 4) + list(APPEND IDF_COMPONENTS esp_adc_cal) +endif() + if(IDF_VERSION_MINOR GREATER_EQUAL 1 OR IDF_VERSION_MAJOR GREATER_EQUAL 5) list(APPEND IDF_COMPONENTS esp_netif) endif()