CMakeLists.txt 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. return()
  6. endif()
  7. set(srcs
  8. "esp_netif_handlers.c"
  9. "esp_netif_objects.c"
  10. "esp_netif_defaults.c"
  11. "lwip/esp_netif_lwip.c"
  12. "lwip/esp_netif_lwip_defaults.c"
  13. "lwip/netif/wlanif.c"
  14. "lwip/netif/ethernetif.c"
  15. "lwip/netif/esp_pbuf_ref.c" )
  16. set(include_dirs "include")
  17. set(priv_include_dirs "lwip" "private_include")
  18. if(CONFIG_PPP_SUPPORT)
  19. list(APPEND srcs
  20. "lwip/esp_netif_lwip_ppp.c")
  21. endif()
  22. if(CONFIG_LWIP_NETIF_LOOPBACK)
  23. list(APPEND srcs
  24. "loopback/esp_netif_loopback.c")
  25. endif()
  26. if(CONFIG_ESP_NETIF_L2_TAP)
  27. list(APPEND srcs
  28. "vfs_l2tap/esp_vfs_l2tap.c")
  29. endif()
  30. if(CONFIG_ESP_NETIF_BRIDGE_EN)
  31. list(APPEND srcs
  32. "lwip/esp_netif_br_glue.c")
  33. endif()
  34. idf_component_register(SRCS "${srcs}"
  35. INCLUDE_DIRS "${include_dirs}"
  36. PRIV_INCLUDE_DIRS "${priv_include_dirs}"
  37. REQUIRES esp_event
  38. PRIV_REQUIRES lwip
  39. LDFRAGMENTS linker.lf)
  40. if(CONFIG_ESP_NETIF_L2_TAP OR CONFIG_ESP_NETIF_BRIDGE_EN)
  41. idf_component_optional_requires(PRIVATE esp_eth vfs)
  42. endif()
  43. target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")