CMakeLists.txt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. idf_build_get_property(target IDF_TARGET)
  2. if(${target} STREQUAL "linux")
  3. # Header only library for linux
  4. idf_component_register(INCLUDE_DIRS include
  5. SRCS protocol_examples_utils.c)
  6. return()
  7. endif()
  8. set(srcs "stdin_out.c"
  9. "addr_from_stdin.c"
  10. "connect.c"
  11. "wifi_connect.c"
  12. "protocol_examples_utils.c")
  13. if(CONFIG_EXAMPLE_PROVIDE_WIFI_CONSOLE_CMD)
  14. list(APPEND srcs "console_cmd.c")
  15. endif()
  16. if(CONFIG_EXAMPLE_CONNECT_ETHERNET)
  17. list(APPEND srcs "eth_connect.c")
  18. endif()
  19. if(CONFIG_EXAMPLE_CONNECT_PPP)
  20. list(APPEND srcs "ppp_connect.c")
  21. endif()
  22. idf_component_register(SRCS "${srcs}"
  23. INCLUDE_DIRS "include"
  24. PRIV_REQUIRES esp_netif driver esp_wifi vfs)
  25. if(CONFIG_EXAMPLE_PROVIDE_WIFI_CONSOLE_CMD)
  26. idf_component_optional_requires(PRIVATE console)
  27. endif()
  28. if(CONFIG_EXAMPLE_CONNECT_ETHERNET)
  29. idf_component_optional_requires(PRIVATE esp_eth)
  30. endif()
  31. if(CONFIG_EXAMPLE_CONNECT_PPP)
  32. idf_component_optional_requires(PRIVATE esp_tinyusb espressif__esp_tinyusb)
  33. endif()