2021-07-08 16:14:25 +00:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
2022-09-26 11:22:20 +00:00
|
|
|
set(srcs_lwip
|
|
|
|
"lwip/esp_netif_lwip.c"
|
2022-10-27 17:07:07 +00:00
|
|
|
"lwip/esp_netif_sntp.c"
|
2022-09-26 11:22:20 +00:00
|
|
|
"lwip/esp_netif_lwip_defaults.c"
|
|
|
|
"lwip/netif/wlanif.c"
|
|
|
|
"lwip/netif/ethernetif.c"
|
|
|
|
"lwip/netif/esp_pbuf_ref.c")
|
|
|
|
|
|
|
|
|
2021-06-23 02:20:08 +00:00
|
|
|
set(srcs
|
|
|
|
"esp_netif_handlers.c"
|
|
|
|
"esp_netif_objects.c"
|
2022-09-26 11:22:20 +00:00
|
|
|
"esp_netif_defaults.c")
|
2021-06-23 02:20:08 +00:00
|
|
|
|
|
|
|
set(include_dirs "include")
|
2022-09-26 11:22:20 +00:00
|
|
|
set(priv_include_dirs "private_include")
|
2021-06-23 02:20:08 +00:00
|
|
|
|
2022-07-22 08:14:37 +00:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
if(${target} STREQUAL "linux")
|
|
|
|
list(APPEND include_dirs
|
|
|
|
"linux/stubs/include")
|
|
|
|
endif()
|
|
|
|
|
2021-06-23 02:20:08 +00:00
|
|
|
if(CONFIG_PPP_SUPPORT)
|
2022-09-26 11:22:20 +00:00
|
|
|
list(APPEND srcs_lwip lwip/esp_netif_lwip_ppp.c)
|
2021-06-23 02:20:08 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2022-05-02 13:47:05 +00:00
|
|
|
if(CONFIG_ESP_NETIF_L2_TAP)
|
2022-09-26 11:22:20 +00:00
|
|
|
list(APPEND srcs vfs_l2tap/esp_vfs_l2tap.c)
|
2022-05-02 13:47:05 +00:00
|
|
|
endif()
|
|
|
|
|
2022-05-06 14:09:24 +00:00
|
|
|
if(CONFIG_ESP_NETIF_BRIDGE_EN)
|
2022-09-26 11:22:20 +00: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 14:09:24 +00:00
|
|
|
endif()
|
|
|
|
|
2021-06-23 02:20:08 +00:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
|
|
|
INCLUDE_DIRS "${include_dirs}"
|
|
|
|
PRIV_INCLUDE_DIRS "${priv_include_dirs}"
|
2022-05-11 14:01:48 +00:00
|
|
|
REQUIRES esp_event
|
2022-09-26 11:22:20 +00:00
|
|
|
PRIV_REQUIRES esp_netif_stack
|
2022-05-11 14:01:48 +00:00
|
|
|
LDFRAGMENTS linker.lf)
|
2022-05-02 13:47:05 +00:00
|
|
|
|
2022-05-06 14:09:24 +00:00
|
|
|
if(CONFIG_ESP_NETIF_L2_TAP OR CONFIG_ESP_NETIF_BRIDGE_EN)
|
2022-05-11 14:01:48 +00:00
|
|
|
idf_component_optional_requires(PRIVATE esp_eth vfs)
|
2022-05-02 13:47:05 +00:00
|
|
|
endif()
|
2022-01-31 18:45:31 +00:00
|
|
|
|
2022-09-26 11:22:20 +00:00
|
|
|
|
2022-01-31 18:45:31 +00:00
|
|
|
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
2022-10-27 17:07:07 +00:00
|
|
|
target_compile_definitions(${COMPONENT_LIB} PRIVATE ESP_NETIF_COMPONENT_BUILD)
|