From cc0f2b3cf002a35dfb4df3a08fe70c77be0d9d6e Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 20 May 2021 18:50:02 +1000 Subject: [PATCH] asio coap: If LWIP IPV6 is disabled, automatically don't build asio & coap - Removes need to manually exclude these components as shown at https://github.com/espressif/esp-idf/issues/3781#issuecomment-825742378 - Hide the config for these components if IPV6 is disabled - The components are still included in the build, but with no source files * Original commit: espressif/esp-idf@e305f2938278c2a39e75c21a3ed59d8f4d4e62fa --- components/asio/CMakeLists.txt | 8 ++++++++ components/asio/Kconfig | 2 ++ components/asio/component.mk | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/components/asio/CMakeLists.txt b/components/asio/CMakeLists.txt index c088644f9..e2421fead 100644 --- a/components/asio/CMakeLists.txt +++ b/components/asio/CMakeLists.txt @@ -1,3 +1,11 @@ +if(NOT CONFIG_LWIP_IPV6 AND NOT CMAKE_BUILD_EARLY_EXPANSION) + # note: the component is still included in the build so it can become visible again in config + # without needing to re-run CMake. However no source or header files are built. + message(STATUS "IPV6 support is disabled so the asio component will not be built") + idf_component_register() + return() +endif() + set(asio_sources "asio/asio/src/asio.cpp") if(CONFIG_ASIO_SSL_SUPPORT) diff --git a/components/asio/Kconfig b/components/asio/Kconfig index 582410e7c..3b488a0c3 100644 --- a/components/asio/Kconfig +++ b/components/asio/Kconfig @@ -1,4 +1,6 @@ menu "ESP-ASIO" + visible if LWIP_IPV6 + config ASIO_SSL_SUPPORT bool "Enable SSL/TLS support of ASIO" default n diff --git a/components/asio/component.mk b/components/asio/component.mk index 30b2907bb..c93c8dbb9 100644 --- a/components/asio/component.mk +++ b/components/asio/component.mk @@ -1,3 +1,5 @@ +ifdef CONFIG_LWIP_IPV6 + COMPONENT_ADD_INCLUDEDIRS := asio/asio/include port/include COMPONENT_PRIV_INCLUDEDIRS := private_include COMPONENT_SRCDIRS := asio/asio/src port/src @@ -7,3 +9,5 @@ COMPONENT_OBJEXCLUDE := asio/asio/src/asio_ssl.o port/src/esp_asio_openssl_stubs endif COMPONENT_SUBMODULES += asio + +endif # CONFIG_LWIP_IPV6