2021-07-08 12:14:25 -04:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
|
|
|
if(${target} STREQUAL "linux")
|
|
|
|
# Header only library for linux
|
|
|
|
idf_component_register(INCLUDE_DIRS include)
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2021-06-22 22:20:08 -04:00
|
|
|
set(srcs
|
|
|
|
"esp_netif_handlers.c"
|
|
|
|
"esp_netif_objects.c"
|
|
|
|
"esp_netif_defaults.c"
|
|
|
|
"lwip/esp_netif_lwip.c"
|
|
|
|
"lwip/esp_netif_lwip_defaults.c"
|
2022-05-11 10:01:48 -04:00
|
|
|
"lwip/netif/wlanif.c"
|
|
|
|
"lwip/netif/ethernetif.c"
|
|
|
|
"lwip/netif/esp_pbuf_ref.c" )
|
2021-06-22 22:20:08 -04:00
|
|
|
|
|
|
|
set(include_dirs "include")
|
|
|
|
set(priv_include_dirs "lwip" "private_include")
|
|
|
|
|
|
|
|
if(CONFIG_LWIP_SLIP_SUPPORT)
|
|
|
|
list(APPEND srcs
|
|
|
|
"lwip/esp_netif_lwip_slip.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_PPP_SUPPORT)
|
|
|
|
list(APPEND srcs
|
|
|
|
"lwip/esp_netif_lwip_ppp.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_LWIP_NETIF_LOOPBACK)
|
|
|
|
list(APPEND srcs
|
|
|
|
"loopback/esp_netif_loopback.c")
|
|
|
|
endif()
|
|
|
|
|
2022-05-02 09:47:05 -04:00
|
|
|
if(CONFIG_ESP_NETIF_L2_TAP)
|
|
|
|
list(APPEND srcs
|
|
|
|
"vfs_l2tap/esp_vfs_l2tap.c")
|
|
|
|
endif()
|
|
|
|
|
2022-05-06 10:09:24 -04:00
|
|
|
if(CONFIG_ESP_NETIF_BRIDGE_EN)
|
|
|
|
list(APPEND srcs
|
|
|
|
"lwip/esp_netif_br_glue.c")
|
|
|
|
endif()
|
|
|
|
|
2021-06-22 22:20:08 -04:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
|
|
|
INCLUDE_DIRS "${include_dirs}"
|
|
|
|
PRIV_INCLUDE_DIRS "${priv_include_dirs}"
|
2022-05-11 10:01:48 -04:00
|
|
|
REQUIRES esp_event
|
|
|
|
PRIV_REQUIRES lwip
|
|
|
|
LDFRAGMENTS linker.lf)
|
2022-05-02 09:47:05 -04:00
|
|
|
|
2022-05-06 10:09:24 -04:00
|
|
|
if(CONFIG_ESP_NETIF_L2_TAP OR CONFIG_ESP_NETIF_BRIDGE_EN)
|
2022-05-11 10:01:48 -04:00
|
|
|
idf_component_optional_requires(PRIVATE esp_eth vfs)
|
2022-05-02 09:47:05 -04:00
|
|
|
endif()
|