CMakeLists.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. if(NOT CONFIG_LWIP_IPV6 AND NOT CMAKE_BUILD_EARLY_EXPANSION)
  2. message(STATUS "IPV6 support is disabled so the coap component will not be built")
  3. # note: the component is still included in the build so it can become visible again in config
  4. # without needing to re-run CMake. However no source or header files are built.
  5. idf_component_register()
  6. return()
  7. endif()
  8. set(include_dirs port/include port/include libcoap/include)
  9. set(srcs
  10. "libcoap/src/address.c"
  11. "libcoap/src/async.c"
  12. "libcoap/src/block.c"
  13. "libcoap/src/coap_asn1.c"
  14. "libcoap/src/coap_cache.c"
  15. "libcoap/src/coap_debug.c"
  16. "libcoap/src/coap_event.c"
  17. "libcoap/src/coap_hashkey.c"
  18. "libcoap/src/coap_io.c"
  19. "libcoap/src/coap_mbedtls.c"
  20. "libcoap/src/coap_notls.c"
  21. "libcoap/src/coap_prng.c"
  22. "libcoap/src/coap_session.c"
  23. "libcoap/src/coap_tcp.c"
  24. "libcoap/src/coap_time.c"
  25. "libcoap/src/encode.c"
  26. "libcoap/src/mem.c"
  27. "libcoap/src/net.c"
  28. "libcoap/src/option.c"
  29. "libcoap/src/pdu.c"
  30. "libcoap/src/resource.c"
  31. "libcoap/src/str.c"
  32. "libcoap/src/subscribe.c"
  33. "libcoap/src/uri.c")
  34. idf_component_register(SRCS "${srcs}"
  35. INCLUDE_DIRS "${include_dirs}"
  36. REQUIRES lwip mbedtls)
  37. # Silence format truncation warning, until it is fixed upstream
  38. # set_source_files_properties(libcoap/src/coap_debug.c PROPERTIES COMPILE_FLAGS -Wno-format-truncation)
  39. # Needed for coap headers in public builds, also.
  40. #
  41. # TODO: find a way to move this to a port header
  42. target_compile_definitions(${COMPONENT_LIB} PUBLIC WITH_POSIX)