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()
|
|
|
|
|
2022-09-26 07:22:20 -04:00
|
|
|
set(srcs_lwip
|
|
|
|
"lwip/esp_netif_lwip.c"
|
|
|
|
"lwip/esp_netif_lwip_defaults.c"
|
|
|
|
"lwip/netif/wlanif.c"
|
|
|
|
"lwip/netif/ethernetif.c"
|
|
|
|
"lwip/netif/esp_pbuf_ref.c")
|
|
|
|
|
|
|
|
|
2021-06-22 22:20:08 -04:00
|
|
|
set(srcs
|
|
|
|
"esp_netif_handlers.c"
|
|
|
|
"esp_netif_objects.c"
|
2022-09-26 07:22:20 -04:00
|
|
|
"esp_netif_defaults.c")
|
2021-06-22 22:20:08 -04:00
|
|
|
|
|
|
|
set(include_dirs "include")
|
2022-09-26 07:22:20 -04:00
|
|
|
set(priv_include_dirs "private_include")
|
2021-06-22 22:20:08 -04:00
|
|
|
|
|
|
|
if(CONFIG_PPP_SUPPORT)
|
2022-09-26 07:22:20 -04:00
|
|
|
list(APPEND srcs_lwip lwip/esp_netif_lwip_ppp.c)
|
2021-06-22 22:20:08 -04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2022-05-02 09:47:05 -04:00
|
|
|
if(CONFIG_ESP_NETIF_L2_TAP)
|
2022-09-26 07:22:20 -04:00
|
|
|
list(APPEND srcs vfs_l2tap/esp_vfs_l2tap.c)
|
2022-05-02 09:47:05 -04:00
|
|
|
endif()
|
|
|
|
|
2022-05-06 10:09:24 -04:00
|
|
|
if(CONFIG_ESP_NETIF_BRIDGE_EN)
|
2022-09-26 07:22:20 -04:00
|
|
|
list(APPEND srcs_lwip lwip/esp_netif_br_glue.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_ESP_NETIF_LOOPBACK)
|
|
|
|
list(APPEND srcs loopback/esp_netif_loopback.c)
|
|
|
|
elseif(CONFIG_ESP_NETIF_TCPIP_LWIP)
|
|
|
|
list(APPEND srcs ${srcs_lwip})
|
|
|
|
list(APPEND priv_include_dirs lwip)
|
2022-05-06 10:09:24 -04:00
|
|
|
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()
|
2022-01-31 13:45:31 -05:00
|
|
|
|
2022-09-26 07:22:20 -04:00
|
|
|
|
2022-01-31 13:45:31 -05:00
|
|
|
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
2022-10-27 13:07:07 -04:00
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE ESP_NETIF_COMPONENT_BUILD)
|