From 84b2437625e9050bd4cbe2c821a9c1825d161f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=A3=D1=81?= Date: Sat, 24 Jan 2026 20:07:10 +0500 Subject: [PATCH] chore: switch to eil-cmake-utils --- .gitmodules | 6 +++--- CMakeLists.txt | 29 ++++++++++++++++------------- Kconfig.i2c | 19 ------------------- common | 1 - eil-cmake-utils | 1 + 5 files changed, 20 insertions(+), 36 deletions(-) delete mode 100644 Kconfig.i2c delete mode 160000 common create mode 160000 eil-cmake-utils diff --git a/.gitmodules b/.gitmodules index a9554a2..928766e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "common"] - path = common - url = https://github.com/esp-idf-lib/common.git +[submodule "eil-cmake-utils"] + path = eil-cmake-utils + url = git@github.com:esp-idf-lib/eil-cmake-utils.git diff --git a/CMakeLists.txt b/CMakeLists.txt index bc4ae88..2ef3db7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,24 @@ -if(${IDF_TARGET} STREQUAL esp8266) - set(req esp8266 freertos log esp_idf_lib_helpers) -elseif(${IDF_VERSION_MAJOR} STREQUAL 5 AND ${IDF_VERSION_MINOR} LESS 3) - set(req driver freertos log esp_idf_lib_helpers) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/eil-cmake-utils/cmake) +include(eil_check_idf_features) +eil_check_idf_has_esp_drivers() + +# List of common ESP-IDF components required by this component +set(REQUIRED_COMPONENTS freertos esp_idf_lib_helpers) + +if(EIL_IDF_HAS_ESP_DRIVERS) + list(APPEND REQUIRED_COMPONENTS esp_driver_gpio) else() - set(req esp_driver_gpio freertos log esp_idf_lib_helpers) + list(APPEND REQUIRED_COMPONENTS driver) +endif() + +if(${IDF_TARGET} STREQUAL esp8266) + set(REQUIRED_COMPONENTS esp8266 freertos esp_idf_lib_helpers) endif() idf_component_register( SRCS dht.c INCLUDE_DIRS . - REQUIRES ${req} + REQUIRES ${REQUIRED_COMPONENTS} ) -# include common cmake file for components -set(ESP_IDF_LIB_CMAKE ${CMAKE_CURRENT_LIST_DIR}/common/cmake/esp-idf-lib.cmake) -if(EXISTS ${ESP_IDF_LIB_CMAKE}) - include(${ESP_IDF_LIB_CMAKE}) -else() - message(WARNING "${ESP_IDF_LIB_CMAKE} not found") -endif() +include(eil_ci) diff --git a/Kconfig.i2c b/Kconfig.i2c deleted file mode 100644 index 29d0ac2..0000000 --- a/Kconfig.i2c +++ /dev/null @@ -1,19 +0,0 @@ -config EXAMPLE_I2C_MASTER_SCL - int "SCL GPIO Number" - default 5 if IDF_TARGET_ESP8266 - default 6 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32C61 - default 19 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - default 4 if IDF_TARGET_ESP32H2 - default 4 if IDF_TARGET_ESP32P4 - help - GPIO number for I2C Master clock line. - -config EXAMPLE_I2C_MASTER_SDA - int "SDA GPIO Number" - default 4 if IDF_TARGET_ESP8266 - default 5 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32C61 - default 18 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - default 3 if IDF_TARGET_ESP32H2 - default 3 if IDF_TARGET_ESP32P4 - help - GPIO number for I2C Master data line. diff --git a/common b/common deleted file mode 160000 index 58f97e3..0000000 --- a/common +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 58f97e3e8de40a3c8e3b0bb14bff176b389827ac diff --git a/eil-cmake-utils b/eil-cmake-utils new file mode 160000 index 0000000..c91055e --- /dev/null +++ b/eil-cmake-utils @@ -0,0 +1 @@ +Subproject commit c91055e05b68b6f0cdbd73969e725d0b91aa25fa