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