mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
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
This commit is contained in:
parent
535e9ea594
commit
e305f29382
@ -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)
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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"
|
||||||
|
@ -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
|
||||||
|
@ -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)"
|
||||||
|
@ -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)
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user