2021-05-20 04:50:02 -04:00
|
|
|
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()
|
|
|
|
|
2021-03-02 10:32:07 -05:00
|
|
|
set(include_dirs port/include port/include libcoap/include)
|
2018-01-11 21:49:13 -05:00
|
|
|
|
2020-11-10 02:40:01 -05:00
|
|
|
set(srcs
|
2019-06-21 02:29:32 -04:00
|
|
|
"libcoap/src/address.c"
|
|
|
|
"libcoap/src/async.c"
|
|
|
|
"libcoap/src/block.c"
|
2021-03-02 10:32:07 -05:00
|
|
|
"libcoap/src/coap_asn1.c"
|
|
|
|
"libcoap/src/coap_cache.c"
|
|
|
|
"libcoap/src/coap_debug.c"
|
2019-06-21 02:29:32 -04:00
|
|
|
"libcoap/src/coap_event.c"
|
|
|
|
"libcoap/src/coap_hashkey.c"
|
2021-03-02 10:32:07 -05:00
|
|
|
"libcoap/src/coap_io.c"
|
|
|
|
"libcoap/src/coap_mbedtls.c"
|
|
|
|
"libcoap/src/coap_notls.c"
|
|
|
|
"libcoap/src/coap_prng.c"
|
2019-06-21 02:29:32 -04:00
|
|
|
"libcoap/src/coap_session.c"
|
2021-03-02 10:32:07 -05:00
|
|
|
"libcoap/src/coap_tcp.c"
|
2019-06-21 02:29:32 -04:00
|
|
|
"libcoap/src/coap_time.c"
|
|
|
|
"libcoap/src/encode.c"
|
|
|
|
"libcoap/src/mem.c"
|
|
|
|
"libcoap/src/net.c"
|
|
|
|
"libcoap/src/option.c"
|
|
|
|
"libcoap/src/pdu.c"
|
|
|
|
"libcoap/src/resource.c"
|
|
|
|
"libcoap/src/str.c"
|
|
|
|
"libcoap/src/subscribe.c"
|
2021-03-02 10:32:07 -05:00
|
|
|
"libcoap/src/uri.c")
|
2018-01-11 21:49:13 -05:00
|
|
|
|
2019-04-28 03:38:23 -04:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
2019-06-21 02:29:32 -04:00
|
|
|
INCLUDE_DIRS "${include_dirs}"
|
2019-07-31 06:51:25 -04:00
|
|
|
REQUIRES lwip mbedtls)
|
2018-01-11 21:49:13 -05:00
|
|
|
|
2019-03-28 04:28:25 -04:00
|
|
|
# Silence format truncation warning, until it is fixed upstream
|
2021-03-02 10:32:07 -05:00
|
|
|
# set_source_files_properties(libcoap/src/coap_debug.c PROPERTIES COMPILE_FLAGS -Wno-format-truncation)
|
2019-05-09 22:53:08 -04:00
|
|
|
|
|
|
|
# Needed for coap headers in public builds, also.
|
|
|
|
#
|
|
|
|
# TODO: find a way to move this to a port header
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PUBLIC WITH_POSIX)
|