From 65dad0d46fdfbb41a608478466dd9fae7a779f61 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 31 Oct 2019 13:39:17 +1100 Subject: [PATCH] build system: Remove some dependencies from esp32 & esp32s2beta Possible now that wifi related source files are all in esp_wifi --- components/esp32/CMakeLists.txt | 4 ++-- components/esp32/cpu_start.c | 1 - components/esp32s2beta/CMakeLists.txt | 4 ++-- components/esp_wifi/CMakeLists.txt | 1 + components/mbedtls/CMakeLists.txt | 3 ++- tools/cmake/build.cmake | 6 ++++-- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/components/esp32/CMakeLists.txt b/components/esp32/CMakeLists.txt index 4f97a3c1c..c66f3958c 100644 --- a/components/esp32/CMakeLists.txt +++ b/components/esp32/CMakeLists.txt @@ -36,12 +36,12 @@ else() "task_wdt.c") set(include_dirs "include") - set(requires driver esp_event efuse soc) #unfortunately rom/uart uses SOC registers directly + set(requires driver efuse soc) #unfortunately rom/uart uses SOC registers directly # driver is a public requirement because esp_sleep.h uses gpio_num_t & touch_pad_t # app_update is added here because cpu_start.c uses esp_ota_get_app_description() function. set(priv_requires app_trace app_update bootloader_support log mbedtls nvs_flash pthread - spi_flash vfs wpa_supplicant espcoredump esp_common esp_wifi perfmon) + spi_flash vfs espcoredump esp_common perfmon) set(fragments linker.lf ld/esp32_fragments.lf) idf_component_register(SRCS "${srcs}" diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index ee5e38eee..e42c5fd53 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -45,7 +45,6 @@ #include "esp_spi_flash.h" #include "esp_flash_internal.h" #include "nvs_flash.h" -#include "esp_event.h" #include "esp_spi_flash.h" #include "esp_private/crosscore_int.h" #include "esp_log.h" diff --git a/components/esp32s2beta/CMakeLists.txt b/components/esp32s2beta/CMakeLists.txt index b707ddaaf..d32575be8 100644 --- a/components/esp32s2beta/CMakeLists.txt +++ b/components/esp32s2beta/CMakeLists.txt @@ -33,13 +33,13 @@ else() "task_wdt.c") set(include_dirs "include") - set(requires driver esp_event efuse soc) #unfortunately rom/uart uses SOC registers directly + set(requires driver efuse soc) #unfortunately rom/uart uses SOC registers directly # driver is a public requirement because esp_sleep.h uses gpio_num_t & touch_pad_t # app_update is added here because cpu_start.c uses esp_ota_get_app_description() function. set(priv_requires app_trace app_update bootloader_support log mbedtls nvs_flash - pthread spi_flash vfs wpa_supplicant espcoredump esp_common esp_wifi) + pthread spi_flash vfs espcoredump esp_common) set(fragments linker.lf ld/esp32s2beta_fragments.lf) diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index f16d4d16e..17fe54ed2 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -19,6 +19,7 @@ idf_component_register(SRCS "src/coexist.c" "src/wifi_netif.c" "${idf_target}/esp_adapter.c" INCLUDE_DIRS "include" "${idf_target}/include" + REQUIRES esp_event PRIV_REQUIRES wpa_supplicant nvs_flash esp_netif LDFRAGMENTS "${ldfragments}") diff --git a/components/mbedtls/CMakeLists.txt b/components/mbedtls/CMakeLists.txt index a46a6b6f0..08e6f1ee0 100644 --- a/components/mbedtls/CMakeLists.txt +++ b/components/mbedtls/CMakeLists.txt @@ -44,4 +44,5 @@ endforeach() set_property(TARGET mbedcrypto APPEND PROPERTY LINK_INTERFACE_LIBRARIES mbedtls) # Link mbedtls libraries to component library -target_link_libraries(${COMPONENT_LIB} INTERFACE ${mbedtls_targets}) \ No newline at end of file +target_link_libraries(${COMPONENT_LIB} INTERFACE ${mbedtls_targets}) + diff --git a/tools/cmake/build.cmake b/tools/cmake/build.cmake index 517fdf8aa..e010a4401 100644 --- a/tools/cmake/build.cmake +++ b/tools/cmake/build.cmake @@ -152,7 +152,9 @@ function(__build_init idf_path) endforeach() # Set components required by all other components in the build - set(requires_common cxx newlib freertos heap log soc esp_rom esp_common xtensa) + # + # - lwip is here so that #include works without any special provisions + set(requires_common cxx newlib freertos heap log lwip soc esp_rom esp_common xtensa) idf_build_set_property(__COMPONENT_REQUIRES_COMMON "${requires_common}") __build_get_idf_git_revision() @@ -490,4 +492,4 @@ function(idf_build_get_config var config) get_property(val TARGET __idf_build_target PROPERTY ${config}) endif() set(${var} ${val} PARENT_SCOPE) -endfunction() \ No newline at end of file +endfunction()