Explorar el Código

mbedtls: remove dependency on driver component

- keep `esp_pm` dependency conditional in mbedtls
- refactor `bt` cmakelist to keep dependencies as private

Related: IDF-1265
Mahavir Jain hace 3 años
padre
commit
a94c74c26b

+ 2 - 1
components/bt/CMakeLists.txt

@@ -678,7 +678,8 @@ endif()
 idf_component_register(SRCS "${srcs}"
                 INCLUDE_DIRS "${include_dirs}"
                 PRIV_INCLUDE_DIRS "${priv_include_dirs}"
-                REQUIRES nvs_flash soc esp_timer esp_pm esp_phy mbedtls
+                REQUIRES esp_timer
+                PRIV_REQUIRES nvs_flash soc esp_pm esp_phy mbedtls driver
                 LDFRAGMENTS "linker.lf")
 
 if(CONFIG_BT_ENABLED)

+ 1 - 1
components/bt/test/CMakeLists.txt

@@ -1,5 +1,5 @@
 if(CONFIG_BT_ENABLED OR CMAKE_BUILD_EARLY_EXPANSION)
     idf_component_register(SRC_DIRS "."
                         PRIV_INCLUDE_DIRS "."
-                        PRIV_REQUIRES cmock nvs_flash bt)
+                        PRIV_REQUIRES cmock nvs_flash bt esp_ringbuf)
 endif()

+ 1 - 1
components/espcoredump/CMakeLists.txt

@@ -24,4 +24,4 @@ idf_component_register(SRCS ${srcs}
                     INCLUDE_DIRS ${includes}
                     PRIV_INCLUDE_DIRS ${priv_includes}
                     LDFRAGMENTS linker.lf
-                    PRIV_REQUIRES spi_flash app_update mbedtls esp_rom soc)
+                    PRIV_REQUIRES spi_flash app_update mbedtls esp_rom soc driver)

+ 4 - 2
components/mbedtls/CMakeLists.txt

@@ -254,8 +254,10 @@ if(CONFIG_MBEDTLS_DYNAMIC_BUFFER)
 endif()
 
 set_property(TARGET mbedcrypto APPEND PROPERTY LINK_INTERFACE_LIBRARIES mbedtls)
-set_property(TARGET mbedcrypto APPEND PROPERTY LINK_LIBRARIES idf::driver)
-set_property(TARGET mbedcrypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES idf::driver)
+
+if(CONFIG_PM_ENABLE)
+    target_link_libraries(mbedcrypto PRIVATE idf::esp_pm)
+endif()
 
 target_link_libraries(${COMPONENT_LIB} ${linkage_type} ${mbedtls_targets})
 

+ 2 - 0
components/mbedtls/port/aes/dma/esp_aes.c

@@ -35,7 +35,9 @@
 #include "soc/lldesc.h"
 #include "esp_heap_caps.h"
 #include "sys/param.h"
+#if CONFIG_PM_ENABLE
 #include "esp_pm.h"
+#endif
 #include "esp_crypto_lock.h"
 #include "hal/aes_hal.h"
 #include "aes/esp_aes_internal.h"

+ 2 - 0
components/mbedtls/port/esp_bignum.c

@@ -20,7 +20,9 @@
 #include "esp_log.h"
 #include "esp_attr.h"
 #include "esp_intr_alloc.h"
+#if CONFIG_PM_ENABLE
 #include "esp_pm.h"
+#endif
 
 #include "freertos/FreeRTOS.h"
 #include "freertos/semphr.h"

+ 1 - 1
components/protocomm/CMakeLists.txt

@@ -46,5 +46,5 @@ endif()
 idf_component_register(SRCS "${srcs}"
                     INCLUDE_DIRS "${include_dirs}"
                     PRIV_INCLUDE_DIRS "${priv_include_dirs}"
-                    PRIV_REQUIRES protobuf-c mbedtls console esp_http_server
+                    PRIV_REQUIRES protobuf-c mbedtls console esp_http_server driver
                     REQUIRES bt)

+ 0 - 1
components/protocomm/src/transports/protocomm_nimble.c

@@ -7,7 +7,6 @@
 #include <sys/param.h>
 #include <esp_log.h>
 #include <string.h>
-#include "nvs_flash.h"
 
 #include <protocomm.h>
 #include <protocomm_ble.h>

+ 1 - 2
examples/bluetooth/esp_ble_mesh/ble_mesh_coex_test/components/case/wifi_connect.c

@@ -1,7 +1,7 @@
 /*
  * ESP BLE Mesh Example
  *
- * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
+ * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
  *
  * SPDX-License-Identifier: Unlicense OR CC0-1.0
  */
@@ -23,7 +23,6 @@
 
 #include "esp_log.h"
 #include "esp_netif.h"
-#include "driver/gpio.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
 #include "freertos/event_groups.h"

+ 2 - 1
examples/bluetooth/esp_hid_device/main/CMakeLists.txt

@@ -4,4 +4,5 @@ set(include_dirs ".")
 
 idf_component_register(SRCS "${srcs}"
                        INCLUDE_DIRS "${include_dirs}"
-                       REQUIRES esp_hid)
+                       REQUIRES esp_hid
+                       PRIV_REQUIRES nvs_flash)

+ 2 - 1
examples/bluetooth/esp_hid_host/main/CMakeLists.txt

@@ -4,4 +4,5 @@ set(include_dirs ".")
 
 idf_component_register(SRCS "${srcs}"
                        INCLUDE_DIRS "${include_dirs}"
-                       REQUIRES esp_hid)
+                       REQUIRES esp_hid
+                       PRIV_REQUIRES nvs_flash)