Merge branch 'feature/lwip_ipv6_automatic_coap_asio' into 'master'

asio coap: If LWIP IPV6 is disabled, automatically don't build asio & coap

Closes IDF-2832

See merge request espressif/esp-idf!13616
This commit is contained in:
David Čermák 2021-05-24 12:39:37 +00:00
commit 36e6938920
9 changed files with 29 additions and 5 deletions

View File

@ -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") set(asio_sources "asio/asio/src/asio.cpp")
if(CONFIG_ASIO_SSL_SUPPORT) if(CONFIG_ASIO_SSL_SUPPORT)

View File

@ -1,4 +1,6 @@
menu "ESP-ASIO" menu "ESP-ASIO"
visible if LWIP_IPV6
config ASIO_SSL_SUPPORT config ASIO_SSL_SUPPORT
bool "Enable SSL/TLS support of ASIO" bool "Enable SSL/TLS support of ASIO"
default n default n

View File

@ -1,3 +1,5 @@
ifdef CONFIG_LWIP_IPV6
COMPONENT_ADD_INCLUDEDIRS := asio/asio/include port/include COMPONENT_ADD_INCLUDEDIRS := asio/asio/include port/include
COMPONENT_PRIV_INCLUDEDIRS := private_include COMPONENT_PRIV_INCLUDEDIRS := private_include
COMPONENT_SRCDIRS := asio/asio/src port/src 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 endif
COMPONENT_SUBMODULES += asio COMPONENT_SUBMODULES += asio
endif # CONFIG_LWIP_IPV6

View File

@ -1,3 +1,11 @@
if(NOT CONFIG_LWIP_IPV6 AND NOT CMAKE_BUILD_EARLY_EXPANSION)
message(STATUS "IPV6 support is disabled so the coap component will not be built")
# 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.
idf_component_register()
return()
endif()
set(include_dirs port/include port/include/coap libcoap/include libcoap/include/coap2) set(include_dirs port/include port/include/coap libcoap/include libcoap/include/coap2)
set(srcs set(srcs

View File

@ -1,4 +1,5 @@
menu "CoAP Configuration" menu "CoAP Configuration"
visible if LWIP_IPV6
choice COAP_MBEDTLS_ENCRYPTION_MODE choice COAP_MBEDTLS_ENCRYPTION_MODE
prompt "CoAP Encryption method" prompt "CoAP Encryption method"

View File

@ -2,6 +2,8 @@
# Component Makefile # Component Makefile
# #
ifdef CONFIG_LWIP_IPV6
COMPONENT_ADD_INCLUDEDIRS := port/include port/include/coap libcoap/include libcoap/include/coap2 COMPONENT_ADD_INCLUDEDIRS := port/include port/include/coap libcoap/include libcoap/include/coap2
COMPONENT_OBJS = libcoap/src/address.o libcoap/src/async.o libcoap/src/block.o libcoap/src/coap_event.o libcoap/src/coap_hashkey.o libcoap/src/coap_session.o libcoap/src/coap_time.o port/coap_debug.o libcoap/src/encode.o libcoap/src/mem.o libcoap/src/net.o libcoap/src/option.o libcoap/src/pdu.o libcoap/src/resource.o libcoap/src/str.o libcoap/src/subscribe.o libcoap/src/uri.o port/coap_mbedtls.o libcoap/src/coap_io.o port/coap_notls.o COMPONENT_OBJS = libcoap/src/address.o libcoap/src/async.o libcoap/src/block.o libcoap/src/coap_event.o libcoap/src/coap_hashkey.o libcoap/src/coap_session.o libcoap/src/coap_time.o port/coap_debug.o libcoap/src/encode.o libcoap/src/mem.o libcoap/src/net.o libcoap/src/option.o libcoap/src/pdu.o libcoap/src/resource.o libcoap/src/str.o libcoap/src/subscribe.o libcoap/src/uri.o port/coap_mbedtls.o libcoap/src/coap_io.o port/coap_notls.o
@ -12,3 +14,5 @@ COMPONENT_SUBMODULES += libcoap
# Silence format truncation warning, until it is fixed upstream # Silence format truncation warning, until it is fixed upstream
port/coap_debug.o: CFLAGS += -Wno-format-truncation port/coap_debug.o: CFLAGS += -Wno-format-truncation
endif # CONFIG_LWIP_IPV6

View File

@ -324,9 +324,8 @@ menu "LWIP"
default y default y
help help
Enable IPv6 function. If not use IPv6 function, set this option to n. Enable IPv6 function. If not use IPv6 function, set this option to n.
If disable LWIP_IPV6, not adding coap and asio component into the build. If disabling LWIP_IPV6 then some other components (coap and asio) will
Please assign them to EXCLUDE_COMPONENTS in the make or cmake file in your no longer be available.
project directory, so that the component will not be compiled.
config LWIP_IPV6_AUTOCONFIG config LWIP_IPV6_AUTOCONFIG
bool "Enable IPV6 stateless address autoconfiguration (SLAAC)" bool "Enable IPV6 stateless address autoconfiguration (SLAAC)"

View File

@ -5,7 +5,6 @@ cmake_minimum_required(VERSION 3.5)
# (Not part of the boilerplate) # (Not part of the boilerplate)
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection. # This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common) set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
set(EXCLUDE_COMPONENTS "coap" "asio")
include($ENV{IDF_PATH}/tools/cmake/project.cmake) include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(tcp_server) project(tcp_server)

View File

@ -6,6 +6,5 @@
PROJECT_NAME := tcp_server PROJECT_NAME := tcp_server
EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_common
EXCLUDE_COMPONENTS = coap asio
include $(IDF_PATH)/make/project.mk include $(IDF_PATH)/make/project.mk