CMakeLists.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. idf_build_get_property(target IDF_TARGET)
  2. if(${target} STREQUAL "linux")
  3. return() # This component is not supported by the POSIX/Linux simulator
  4. endif()
  5. set(include_dirs include/common
  6. include/security
  7. include/transports)
  8. set(priv_include_dirs proto-c src/common src/crypto/srp6a/include)
  9. set(srcs
  10. "src/common/protocomm.c"
  11. "proto-c/constants.pb-c.c"
  12. "proto-c/sec0.pb-c.c"
  13. "proto-c/sec1.pb-c.c"
  14. "proto-c/sec2.pb-c.c"
  15. "proto-c/session.pb-c.c"
  16. "src/transports/protocomm_console.c"
  17. "src/transports/protocomm_httpd.c")
  18. if(CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0)
  19. list(APPEND srcs
  20. "src/security/security0.c")
  21. endif()
  22. if(CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1)
  23. list(APPEND srcs
  24. "src/security/security1.c")
  25. endif()
  26. if(CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2)
  27. list(APPEND srcs
  28. "src/security/security2.c"
  29. "src/crypto/srp6a/esp_srp.c"
  30. "src/crypto/srp6a/esp_srp_mpi.c")
  31. endif()
  32. if(CONFIG_BT_ENABLED)
  33. if(CONFIG_BT_BLUEDROID_ENABLED)
  34. list(APPEND srcs
  35. "src/simple_ble/simple_ble.c"
  36. "src/transports/protocomm_ble.c")
  37. list(APPEND priv_include_dirs
  38. src/simple_ble)
  39. endif()
  40. if(CONFIG_BT_NIMBLE_ENABLED)
  41. list(APPEND srcs
  42. "src/transports/protocomm_nimble.c")
  43. endif()
  44. endif()
  45. idf_component_register(SRCS "${srcs}"
  46. INCLUDE_DIRS "${include_dirs}"
  47. PRIV_INCLUDE_DIRS "${priv_include_dirs}"
  48. PRIV_REQUIRES protobuf-c mbedtls console esp_http_server driver
  49. REQUIRES bt)