1idf_build_get_property(target IDF_TARGET) 2 3set(srcs_lwip 4 "lwip/esp_netif_lwip.c" 5 "lwip/esp_netif_sntp.c" 6 "lwip/esp_netif_lwip_defaults.c" 7 "lwip/netif/wlanif.c" 8 "lwip/netif/ethernetif.c" 9 "lwip/netif/esp_pbuf_ref.c") 10 11 12set(srcs 13 "esp_netif_handlers.c" 14 "esp_netif_objects.c" 15 "esp_netif_defaults.c") 16 17set(include_dirs "include") 18set(priv_include_dirs "private_include") 19 20idf_build_get_property(target IDF_TARGET) 21if(${target} STREQUAL "linux") 22 list(APPEND include_dirs 23 "linux/stubs/include") 24endif() 25 26if(CONFIG_PPP_SUPPORT) 27 list(APPEND srcs_lwip lwip/esp_netif_lwip_ppp.c) 28endif() 29 30 31if(CONFIG_ESP_NETIF_L2_TAP) 32 list(APPEND srcs vfs_l2tap/esp_vfs_l2tap.c) 33endif() 34 35if(CONFIG_ESP_NETIF_BRIDGE_EN) 36 list(APPEND srcs_lwip lwip/esp_netif_br_glue.c) 37endif() 38 39if(CONFIG_ESP_NETIF_LOOPBACK) 40 list(APPEND srcs loopback/esp_netif_loopback.c) 41elseif(CONFIG_ESP_NETIF_TCPIP_LWIP) 42 list(APPEND srcs ${srcs_lwip}) 43 list(APPEND priv_include_dirs lwip) 44endif() 45 46idf_component_register(SRCS "${srcs}" 47 INCLUDE_DIRS "${include_dirs}" 48 PRIV_INCLUDE_DIRS "${priv_include_dirs}" 49 REQUIRES esp_event 50 PRIV_REQUIRES esp_netif_stack 51 LDFRAGMENTS linker.lf) 52 53if(CONFIG_ESP_NETIF_L2_TAP OR CONFIG_ESP_NETIF_BRIDGE_EN) 54 idf_component_optional_requires(PRIVATE esp_eth vfs) 55endif() 56 57 58target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") 59target_compile_definitions(${COMPONENT_LIB} PRIVATE ESP_NETIF_COMPONENT_BUILD) 60