Просмотр исходного кода

bugfix: Add esp_timer to PRIV_REQUIRES

This fixes the issue where esp_timer was not a dependency of esp-serial-flasher and newer versions of ESP-IDF exposed this flaw by refusing to build projects that use esp-serial-flasher.
Djordje Nedic 3 лет назад
Родитель
Сommit
b64c845d73
2 измененных файлов с 9 добавлено и 2 удалено
  1. 8 1
      CMakeLists.txt
  2. 1 1
      idf_component.yml

+ 8 - 1
CMakeLists.txt

@@ -11,10 +11,17 @@ if (DEFINED ESP_PLATFORM)
     # Register component to esp-idf build system
     list(APPEND srcs port/esp32_port.c)
     if ("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER "4.0")
+        # esp_timer component was introduced in v4.2
+        set(priv_requires driver)
+        if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER "4.1")
+            list(APPEND priv_requires esp_timer)
+        endif()
+
         idf_component_register(SRCS ${srcs}
                                INCLUDE_DIRS include port
                                PRIV_INCLUDE_DIRS private_include
-                               PRIV_REQUIRES driver)
+                               PRIV_REQUIRES ${priv_requires})
+
         set(target ${COMPONENT_LIB})
         component_compile_options(-Wstrict-prototypes)
     else()

+ 1 - 1
idf_component.yml

@@ -1,3 +1,3 @@
-version: "0.0.2"
+version: "0.0.3"
 description: Serial flasher component provides portable library for flashing Espressif SoCs from other host microcontroller
 url: https://github.com/espressif/esp-serial-flasher